﻿using GalaSoft.MvvmLight;
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using ZFSDomain.Interface.Base;
using ZFSDomain.Interface.User;
using ZFSDomain.SysModule;
using ZFSDomain.View.Sign;
using ZFSDomain.ViewModel.Sign;

namespace ZFSDomain.ViewDialog.Sign
{
    /// <summary>
    /// 登录窗口
    /// </summary>
    public class LoginViewDlg : BaseViewDialog<Login>, ILoginDialog
    {
        public override void BindViewModel<TViewModel>(TViewModel viewModel)
        {
            var dialog = GetDialog();
            (dialog as Window).DataContext = viewModel;
        }

        public override void Close()
        {
            (GetDialog() as Window).Close();
        }

        public override Task<bool> ShowDialog(DialogOpenedEventHandler openedEventHandler,DialogClosingEventHandler closingEventHandler)
        {
            var dialog = GetDialog();
            (dialog as Window).ShowDialog();
            return Task.FromResult(true);
        }
    }
}
